<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="DataTags.aspx.cs" Inherits="Users" Title="ABC SuperSign - Users" %>
<%@ Register Src="UserAccess.ascx" TagName="UserAccess" TagPrefix="uc1" %>
<%@ Register Src="GlobalAjax.ascx" TagName="GlobalAjax" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_Main" Runat="Server">
<form action="#" runat="server">
<asp:ScriptManager ID="ScriptManager_DataTags" runat="server">
</asp:ScriptManager>
<uc1:UserAccess ID="UserAccess1" runat="server" />
<uc2:GlobalAjax ID="ctl_GlobalAjax" runat="server" />

<!-- page title start -->
<h1>
    <span><asp:Label ID="Lbl_PageHeader" runat="server">Data Tags</asp:Label></span>
<%--    <!-- <asp:Button ID="Btn_New" runat="server" Text="Create New Data Tag" CssClass="aspButton"  /> -->
    <input id="Button1" type="button" value="Create New Data Tag" onclick="showIncomplete();" />--%>
</h1>
<!-- page title end -->
<!-- Main Content start -->
<div class="mainHolderFullPage"> 

<!-- right block start -->
<asp:UpdatePanel ID="UPanel_DataTags" runat="server">
    <ContentTemplate>
        <DIV class="row"><asp:Label id="Lbl_EditorAlerts" runat="server" CssClass="aspLabelAlertFail" Visible="False"></asp:Label></DIV>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="5" DataKeyNames="ID" ShowFooter="True" DataSourceID="SqlDataSource1" GridLines="None" Width="100%" OnRowCommand="GridView_RowCommand" OnRowCreated="GridView_RowCreated" OnRowUpdating="GridView_RowUpdating" >
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" Width="100%" />
            <EmptyDataRowStyle Width="100%" />
            <Columns>
                <asp:TemplateField ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButtonUpdate" runat="server" CausesValidation="true" CommandName="Update"
                                Text="Update" />
                            <asp:LinkButton ID="LinkButtonCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                Text="Cancel" />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButtonEdit" runat="server" CausesValidation="False" CommandName="Edit"
                                Text="Edit" />
                            <asp:LinkButton ID="LinkButtonDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                OnClientClick="return confirm('Delete Record?');" Text="Delete" />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:LinkButton ID="LinkButtonUpdate" runat="server" CausesValidation="true" CommandName="Save"
                                Text="Save" />
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Name" SortExpression="Name">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxName" runat="server" Text='<%# Bind("Name") %>'/>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelName" runat="server" Text='<%# Eval("Name") %>'/>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="TextBoxName" runat="server" Width="50px"/>
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Address" SortExpression="Address">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxAddress" runat="server" Text='<%# Bind("Address") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelAddress" runat="server" Text='<%# Eval("Address") %>' />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="TextBoxAddress" runat="server" Width="250px"/>
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Schema" SortExpression="Schema">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxSchema" runat="server" Text='<%# Bind("Schema") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelSchema" runat="server" Text='<%# Eval("Schema") %>' />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="TextBoxSchema" runat="server" Width="250px"/>
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Parser" SortExpression="Parser">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxParser" runat="server" Text='<%# Bind("Parser") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelParser" runat="server" Text='<%# Eval("Parser") %>' />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="TextBoxParser" runat="server" Width="100px"/>
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="DefaultValue" SortExpression="DefaultValue">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxDefaultValue" runat="server" Text='<%# Bind("DefaultValue") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelDefaultValue" runat="server" Text='<%# Eval("DefaultValue") %>' />
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="TextBoxDefaultValue" runat="server" Width="80px"/>
                        </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="LastValue" SortExpression="LastValue">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxLastValue" runat="server" Text='<%# Bind("LastValue") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelLastValue" runat="server" Text='<%# Eval("LastValue") %>' />
                        </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="LastSuccessfulRead" SortExpression="LastSuccessfulRead">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxLastSuccessfulRead" runat="server" Text='<%# Bind("LastSuccessfulRead") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelLastSuccessfulRead" runat="server" Text='<%# Eval("LastSuccessfulRead") %>' />
                        </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="LastChecked" SortExpression="LastChecked">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBoxLastChecked" runat="server" Text='<%# Bind("LastChecked") %>' />
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LabelLastChecked" runat="server" Text='<%# Eval("LastChecked") %>' />
                        </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="TagID" SortExpression="TagID">
                        <ItemTemplate>
                            <asp:Label ID="LabelID" runat="server" Text='<%# Eval("ID") %>' />
                        </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" Width="100%" />
            <EditRowStyle Width="100%" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <HeaderStyle BackColor="Gray" Font-Bold="True" ForeColor="White" Width="100%" />
            <AlternatingRowStyle BackColor="Gainsboro" Width="100%" />
        </asp:GridView>
        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SuperSignConnectionString %>"
            DeleteCommand="DELETE FROM [DATATAG] WHERE [ID] = @ID" SelectCommand="SELECT * FROM [DATATAG]" UpdateCommand="UPDATE [DATATAG] SET [Name] = @Name, [Address] = @Address, [Schema] = @Schema, [Parser] = @Parser, [DefaultValue] = @DefaultValue WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
                <asp:Parameter Name="Schema" Type="String"/>
                <asp:Parameter Name="Parser" Type="String" />
                <asp:Parameter Name="DefaultValue" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </ContentTemplate>
</asp:UpdatePanel>
</div>
<!-- main content end -->
</form>
</asp:Content>

